import request from './request'

// 图片上传
export function uploadImage(data) {
  return request({
    url: '/api/Image/upload',
    method: 'post',
    data
  })
}

// 获取图片信息
export function getImageInfo(fileName) {
  return request({
    url: `/api/Image/info/${fileName}`,
    method: 'get'
  })
}

// 获取用户图片列表
export function getUserImages(userId) {
  return request({
    url: `/api/Image/user/${userId}`,
    method: 'get'
  })
}

// 删除图片
export function deleteImage(fileName) {
  return request({
    url: `/api/Image/${fileName}`,
    method: 'delete'
  })
}

// 创建测试用户
export function createTestUser() {
  return request({
    url: '/api/Image/create-test-user',
    method: 'post'
  })
}

// 获取图片文件URL
export function getImageFileUrl(fileName) {
  return `/api/Image/file/${fileName}`
} 